Handling Errors with MIDI Functions

MIDI audio functions return a nonzero error code. For MIDI-associated errors, the midiInGetErrorText1M4JF8 and midiOutGetErrorTextL_PS1B functions retrieve textual descriptions for the error codes. The application must still look at the error value itself to determine how to proceed, but it can use the error descriptions in dialog boxes to inform users of the error conditions.

The only MIDI functions that do not return error codes are the midiInGetNumDevsEDN_AB and midiOutGetNumDevs18YY8W6 functions. These functions return a value of zero if no devices are present in a system or if any errors are encountered by the function.